package com.lyz.user.designPattern.filterPattern;

import com.lyz.user.designPattern.strategyPattern.demo.PayChannelEnum;

public enum ArticleFilterEnum {

    WORD_COUNT(0, "字数过滤器");

    private int code;

    private String desc;

    ArticleFilterEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据code值获取过滤器枚举
     */
    public static ArticleFilterEnum getByCode(int codeVal) {
        for (ArticleFilterEnum articleFilterEnum : ArticleFilterEnum.values()) {
            if (articleFilterEnum.code == codeVal) {
                return articleFilterEnum;
            }
        }
        return null;
    }

}
